<!DOCTYPE HTML>
<html xmlns:th="www.thymeleaf.org">
<head>
<title>尤洪后台管理</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords"
	content="Novus Admin Panel Responsive web template, Bootstrap Web Templates, Flat Web Templates, Android Compatible web template, 
SmartPhone Compatible web template, free WebDesigns for Nokia, Samsung, LG, SonyEricsson, Motorola web design" />
<script type="application/x-javascript">
	
	 addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } 

</script>
<!-- Bootstrap Core CSS -->
<link href="css/bootstrap.css" rel='stylesheet' type='text/css' />
<!-- Custom CSS -->
<link href="css/style.css" rel='stylesheet' type='text/css' />
<!-- font CSS -->
<!-- font-awesome icons -->
<link href="css/font-awesome.css" rel="stylesheet">
<!-- //font-awesome icons -->
<!-- js-->
<script src="js/jquery-1.11.1.min.js"></script>
<script src="js/modernizr.custom.js"></script>
<!--webfonts-->
<link
	href='http://fonts.useso.com/css?family=Roboto+Condensed:400,300,300italic,400italic,700,700italic'
	rel='stylesheet' type='text/css'>
<!--//webfonts-->
<!--animate-->
<link href="css/animate.css" rel="stylesheet" type="text/css"
	media="all">
<script src="js/wow.min.js"></script>
<script>
	new WOW().init();
</script>
<!--//end-animate-->
<!-- chart -->
<script src="js/Chart.js"></script>
<!-- //chart -->
<!--Calender-->
<link rel="stylesheet" href="css/clndr.css" type="text/css" />
<script src="js/underscore-min.js" type="text/javascript"></script>
<script src="js/moment-2.2.1.js" type="text/javascript"></script>
<script src="js/clndr.js" type="text/javascript"></script>
<script src="js/site.js" type="text/javascript"></script>
<!--End Calender-->
<!-- Metis Menu -->
<script src="js/metisMenu.min.js"></script>
<script src="js/custom.js"></script>
<script src="ckeditor/ckeditor.js"></script>
<script src="js/core.js"></script>
<script src="js/charts.js"></script>
<script src="js/animated.js"></script>
<script src="js/jquery.form.js"></script>
<link href="css/custom.css" rel="stylesheet">
<!--//Metis Menu -->
</head>
<body class="cbp-spmenu-push">
	<div class="main-content">
		<!--left-fixed -navigation-->
		<div class=" sidebar" role="navigation">
			<div class="navbar-collapse">
				<nav class="cbp-spmenu cbp-spmenu-vertical cbp-spmenu-left"
					id="cbp-spmenu-s1">
					<ul class="nav" id="side-menu">
						<li><a href="index.html" class="active"><i
								class="fa fa-home nav_icon"></i>首页</a></li>
						<!-- 商家 -->
						<li th:if="${loginPeople==1}"><a href="#"><i class="fa fa-cogs nav_icon"></i>商品管理 <span
								class="fa arrow"></span></a>
							<ul class="nav nav-second-level collapse">
								<li><a href="javascript:void(0)" onclick="toProductAdd()">添加商品</a>
								</li>
								<li><a href="javascript:void(0)" onclick="toProductFind()">查看商品</a>
								</li>
							</ul>
						</li>
						<li th:if="${loginPeople==1}"><a href="javascript:void(0)" onclick="toOrderFind()"><i
								class="fa fa-cogs nav_icon"></i>订单管理</a>
						</li>
						<!-- 此功能商家/管理员都有 -->
						<li th:if="${loginPeople==1}"><a href="javascript:void(0)"
							onclick="toFinancialChart()"><i
								class="fa fa-bar-chart nav_icon"></i>财务报表 </a></li>
						<li th:if="${loginPeople==1}">
							<!-- 商家专属 --> <a href="javascript:void(0)"
							onclick="toNoticeList()"> <i class="fa fa-envelope nav_icon"></i>网站公告
								<!-- 8 代表着有 8 个公告 --> <span class="nav-badge-btm" th:text="${noticeList.size()}">8</span>
						</a>
						</li>
						<li th:if="${loginPeople==1}"><a href="javascript:void(0)"
							onclick="toCustomerService()"><i class="fa fa-envelope nav_icon"></i>客服 </a></li>
						<li>
						<!-- //商家 -->

						<!-- 管理员 -->
						<li th:if="${loginPeople==2}"><a href="javascript:void(0)" onclick="toClassification()"><i
								class="fa fa-cogs nav_icon"></i>分类管理 </a></li>
						
						<!-- 若违规，封禁后，向商家发送通知邮件让商家修改或下架此商品 --> 
						<!-- <li th:if="${loginPeople==2}">
							<a href="javascript:void(0)" onclick="toProductFind()">
								<i class="fa fa-cogs nav_icon"></i>商品管理
							</a>
						</li> -->
						<li th:if="${loginPeople==2}">
							<!-- 查看/审核/封禁商家 --> <a href="javascript:void(0)"
							onclick="toBusinessAudit()"><i class="fa fa-cogs nav_icon"></i>商家管理
						</a>
						</li>
						<li th:if="${loginPeople==2}">
							<!-- 查看/封禁会员 --> <a href="javascript:void(0)"
							onclick="toUserFind()"><i class="fa fa-cogs nav_icon"></i>会员管理
						</a>
						</li>
						<li th:if="${loginPeople eq 2 and loginAdmin.power eq 1 }"><a href="javascript:void(0)" onclick="toAdminFind()"><i
								class="fa fa-cogs nav_icon"></i>管理员管理 </a></li>
						<li th:if="${loginPeople==2}">
							<!-- 管理员专属 --> <a href="#"><i class="fa fa-cogs nav_icon"></i>网站公告
								<span class="fa arrow"></span></a>
							<ul class="nav nav-second-level collapse">
								<li><a href="javascript:void(0)" onclick="toNoticeWrite()">新增公告</a>
									<a href="javascript:void(0)" onclick="toNoticeList()">查看公告</a>
								</li>
							</ul> <!-- /nav-second-level -->
						</li>

						<!-- //管理员 -->
					</ul>
					<!-- //sidebar-collapse -->
				</nav>
			</div>
		</div>
		<!--left-fixed -navigation-->
		<!-- header-starts -->
		<div class="sticky-header header-section ">
			<div class="header-left">
				<!--toggle button start-->
				<button id="showLeftPush">
					<i class="fa fa-bars"></i>
				</button>
				<!--toggle button end-->
				<!--logo -->
				<div class="logo">
					<a href="index.html">
						<h1>尤洪商城</h1> <span>后 台 管 理</span>
					</a>
				</div>
				<!--//logo-->
				<!--search-box-->
				<div class="search-box">
					<img alt="" src="images/back-index-logo.png" style="width: 292px;height: 49px;">
				</div>
				<!--//end-search-box-->
				<div class="clearfix"></div>
			</div>
			<div class="header-right">
				<div class="profile_details_left">
					<!--notifications of menu start -->
					<ul class="nofitications-dropdown">
						<li class="dropdown head-dpdn"><a href="#"
							class="dropdown-toggle" data-toggle="dropdown"
							aria-expanded="false"> <i class="fa fa-envelope"></i> 
							<span class="badge" th:text="${noticeList.size()}">3</span></a> <!-- 未读数量 -->
							<ul class="dropdown-menu">
								<li>
									<div class="notification_header">
										<h3 th:text="'您有'+${noticeList.size()}+'个公告'">您有3个公告...</h3>
									</div>
								</li>
								<li th:each="notice,noticeStat:${noticeList}" th:if="${noticeStat.count lt 3}">
									<a href="#">
										<div class="user_img">
											<img th:src="'../'+${notice.admin2.defaultImage.url}" style="width: 35px;height: 35px;" alt="">
										</div>
										<div class="notification_desc">
											<p th:text="${notice.title}">管理解决下我的问题</p>
											<p>
												<span th:text="${notice.modifyTime}">1 小时前</span>
											</p>
										</div>
										<div class="clearfix"></div>
									</a>
								</li>
								<li>
									<div class="notification_bottom">
										<a href="javascript:void(0)" onclick="toNoticeList()">查看更多公告...</a>
									</div>
								</li>
							</ul>
						</li>
						<!-- <li class="dropdown head-dpdn" th:if="${loginPeople==1}"><a href="#"
							class="dropdown-toggle" data-toggle="dropdown"
							aria-expanded="false"> <i class="fa fa-bell"></i> <span
								class="badge blue">3</span></a> 未读数量
							<ul class="dropdown-menu">
								<li>
									<div class="notification_header">
										<h3>你有3个未读消息...</h3>
									</div>
								</li>
								<li><a href="#">
										<div class="user_img">
											<img src="images/2.png" alt="">
										</div>
										<div class="notification_desc">
											<p>这个东西我们要这么做...</p>
											<p>
												<span>1 小时前</span>
											</p>
										</div>
										<div class="clearfix"></div>
								</a></li>
								<li class="odd"><a href="#">
										<div class="user_img">
											<img src="images/1.png" alt="">
										</div>
										<div class="notification_desc">
											<p>这个东西我们要这么做...</p>
											<p>
												<span>1 小时前</span>
											</p>
										</div>
										<div class="clearfix"></div>
								</a></li>
								<li><a href="#">
										<div class="user_img">
											<img src="images/3.png" alt="">
										</div>
										<div class="notification_desc">
											<p>这个东西我们要这么做...</p>
											<p>
												<span>1 小时前</span>
											</p>
										</div>
										<div class="clearfix"></div>
								</a></li>
								<li>
									<div class="notification_bottom">
										<a href="javascript:void(0)" onclick="toCustomerService()">查看更多消息...</a>
									</div>
								</li>
							</ul></li> -->
						<!-- 如果登录用户是商家则显示 -->
						<li class="dropdown head-dpdn" th:if="${loginPeople==1}"><a href="#"
							class="dropdown-toggle" data-toggle="dropdown"
							aria-expanded="false"> <i class="fa fa-tasks"></i> <span
								class="badge blue1" th:text="${ordersItemList.size()}">8</span></a> <!-- 未读数量 -->
							<ul class="dropdown-menu">
								<li>
									<div class="notification_header">
										<h3 th:text="'您有'+${ordersItemList.size()}+'个订单待处理...'">你有8个订单待处理...</h3>
									</div>
								</li>
								<li th:each="ordersItem,ordersItemStat:${ordersItemList}" th:if="${ordersItemStat.count lt 4}">
									<a href="#">
										<div class="task-info">
											<span class="task-desc" th:text="'订单价格:'+${ordersItem.subTotal}+'￥'">订单价格:</span>
											<span class="percentage" th:if="${ordersItem.state==2}">33%</span>
											<span class="percentage" th:if="${ordersItem.state==5}">50%</span>
											<div class="clearfix"></div>
										</div>
										<div class="progress progress-striped active">
											<div th:if="${ordersItem.state==2}" class="bar yellow" style="width: 33%;"></div>
											<div th:if="${ordersItem.state==5}" class="bar yellow" style="width: 50%;"></div>
										</div>
									</a>
								</li>
								<li>
									<div class="notification_bottom">
										<a href="javascript:void(0)" onclick="toOrderFind()">查看更多订单...</a>
									</div>
								</li>
							</ul></li>
					</ul>
					<div class="clearfix"></div>
				</div>
				<!--notification menu end -->
				<div class="profile_details">
					<ul>
						<li class="dropdown profile_details_drop"><a href="#"
							class="dropdown-toggle" data-toggle="dropdown"
							aria-expanded="false">
								<div class="profile_img">
									<span class="prfil-img" th:switch="${loginPeople}">
										<img th:case="1" th:if="${loginUser.image2 ne null}" th:src="'../'+${loginBusiness.image2.url}" style="width: 50px;height: 50px;" alt="">
										<img th:case="2" th:if="${loginAdmin.defaultImage ne null}" th:src="'../'+${loginAdmin.defaultImage.url}" style="width: 50px;height: 50px;" alt="">
										<img th:case="*" src="../images/a.png" alt="">
									</span>
									<div class="user-name" th:switch="${loginPeople}">
										<p th:case="1" th:text="${loginUser.trueName}">小张</p>
										<p th:case="2" th:text="${loginAdmin.trueName}">小张</p>
										<span th:if="${loginPeople==1}">商家</span>
										<span th:if="${loginPeople==2}">管理员</span>
										<span th:if="${loginPeople==null}">管理员</span>
										<!-- 管理员或商家 -->
									</div>
									<i class="fa fa-angle-down lnr"></i> <i
										class="fa fa-angle-up lnr"></i>
									<div class="clearfix"></div>
								</div>
						</a>
							<ul class="dropdown-menu drp-mnu">
								<!--<li> <a href="#"><i class="fa fa-cog"></i> 设置</a> </li>-->
								<!-- 设置 -->
								<li><a href="javascript:void(0)" onclick="toBusinessInfo()"><i class="fa fa-user"></i> 个人信息</a></li>
								<li><a href="loginOut.do"><i class="fa fa-sign-out"></i> 登出</a></li>
							</ul></li>
					</ul>
				</div>
				<div class="clearfix"></div>
			</div>
			<div class="clearfix"></div>
		</div>
		<!-- //header-ends -->
		<!-- main content start-->
		<div id="page-wrapper">
			<div class="main-page">
				<div class="row-one">
					<div class="col-md-4 widget">
						<div class="stats-left ">
							<h5>今日</h5>
							<h4>销量</h4>
						</div>
						<div class="stats-right">
							<label th:text="${todySellCount}"> 45</label>
						</div>
						<div class="clearfix"></div>
					</div>
					<div class="col-md-4 widget states-mdl">
						<div class="stats-left">
							<h5>总</h5>
							<h4>销量</h4>
						</div>
						<div class="stats-right">
							<label th:text="${sellCount}"> 80</label>
						</div>
						<div class="clearfix"></div>
					</div>
					<div class="col-md-4 widget states-last">
						<div class="stats-left">
							<h5>总</h5>
							<h4>收藏数</h4>
						</div>
						<div class="stats-right">
							<label th:text="${favoriteCount}">51</label>
						</div>
						<div class="clearfix"></div>
					</div>
					<div class="clearfix"></div>
				</div>
				<!-- 图表显示 -->
				<div class="charts">
					<label style="margin-left: 3%;color: #4F52BA">店铺收入走向图:</label>
					<div id="chartdiv" style="height: 300px;width: 100%;"></div>
				</div>
				<div class="row" th:if="${loginPeople eq 1}" id="ordersItemTable" >

					<div class="col-md-8 stats-info stats-last widget-shadow" th:fragment="ordersItemTable">
						<table class="table table-hover">
							<thead>
								<tr>
									<th>订单号</th>
									<th>商品名</th>
									<th>商品规格</th>
									<th>商品价格</th>
									<th>购买数量</th>
									<th>收货地址</th>
									<th>附言</th>
									<th>订单状态</th>
									<th>操作</th>
									<!-- 点击查看详情，跳转到product-add.html页面，填充所有的数据 -->
								</tr>
							</thead>
							<tbody>
								<div th:each="product:${loginBusiness.products}">
									<div th:each="specss:${product.specs}">
										<tr   th:each="ordersItem,ordersItemStat:${specss.ordersItems}" th:if="${ordersItem.state ne 1 and ordersItem.state ne 9 and ordersItem.state ne 0 and ordersItemStat.count lt 6}">
											<th scope="row" th:text="${ordersItem.id}">1</th>
											<td th:text="${product.name}">古龙香水</td>
											<td th:text="${specss.name}">100ml</td>
											<td th:text="${specss.productPrice}">122.00</td>
											<td th:text="${ordersItem.count}">1</td>
											<td th:text="${ordersItem.orders2.address.name}">湖南省珠晖区衡花路18号</td>
											<td th:if="${ordersItem.logistics eq null or #strings.isEmpty(ordersItem.logistics)}" >空</td>
											<td th:if="${ordersItem.logistics ne null and !#strings.isEmpty(ordersItem.logistics) and ordersItem.logistics.length() gt 5}" th:text="${ordersItem.logistics.substring(0,5)}+'...'">麻烦帮我包好看点</td>
											<td th:if="${ordersItem.logistics ne null and !#strings.isEmpty(ordersItem.logistics) and ordersItem.logistics.length() le 5}" th:text="${ordersItem.logistics}">麻烦帮我包好看点</td>
											<td>
												<label th:if="${ordersItem.state eq 4}" class="label label-success">已签收</label>
												<label th:if="${ordersItem.state eq 3}" class="label label-info">已发货</label>
												<label th:if="${ordersItem.state eq 2}" class="label label-warning">未发货</label>
												<label th:if="${ordersItem.state eq 5}" class="label label-primary">正在退款中</label>
												<label th:if="${ordersItem.state eq 6}" class="label label-default">已退款</label>
												<label th:if="${ordersItem.state eq 7}" class="label label-success">未评价</label>
												<label th:if="${ordersItem.state eq 8}" class="label label-success">已评价</label>
											</td>
											<td>
												<!-- 做修改时设置一个点击事件修改订单状态 --> 
												<select th:if="${ordersItem.state eq 3 or ordersItem.state eq 4 or ordersItem.state eq 6 or ordersItem.state eq 7 or ordersItem.state eq 8}" class="input-sm" name="" disabled="disabled">
													<option value="1" onclick="javascipt:void(0)">无操作</option>
												</select>
												<select th:if="${ordersItem.state eq 2 or ordersItem.state eq 5}" class="input-sm" name="" th:onchange="changeOrderItemState(this,[[${ordersItem.id}]])">
													<option value="1">不操作</option>
													<option th:if="${ordersItem.state} eq 2" th:value="${ordersItem.state}" >已发货</option>
													<option th:if="${ordersItem.state} eq 5" th:value="${ordersItem.state}" >已退款</option>
												</select>
											</td>
										</tr>
									</div>
								</div>
							</tbody>
						</table>
						<!-- 点击此处跳转到订单列表界面 -->
						<a style="margin-left: 84%;" class="label label-info"
							href="javascript:void(0)" onclick="toOrderFind()">查看更多...</a>
					</div>
					<div class="clearfix"></div>
				</div>
			</div>
		</div>
		<!-- 消息提示框 -->
		<div class="col-md-4 modal-grids">
		<button type="button" id="asdf" class="btn btn-primary" data-toggle="modal" data-target=".bs-example-modal-sm" style="display: none;">Small modal</button>
			<div class="modal fade bs-example-modal-sm" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel">
				<div class="modal-dialog modal-sm">
					<div class="modal-content"> 
						<div class="modal-header">
							<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
							<h4 class="modal-title" id="mySmallModalLabel">温馨提示</h4> 
						</div> 
						<div class="modal-body" id="tipContent"> Cras purus odio, vestibulum in vulputate at, tempus viverra turpis.
						</div>
					</div>
				</div>
			</div>
		</div>
		<!-- //消息提示框 -->
		<!--footer-->
		<!--<div class="footer">
		   <p>Copyright &copy; 2016.Company name All rights reserved.<a target="_blank" href="http://sc.chinaz.com/moban/">&#x7F51;&#x9875;&#x6A21;&#x677F;</a></p>
		</div>-->
		<!--//footer-->
	</div>
	<!-- Classie -->
	<script src="js/classie.js"></script>
	<script type="text/javascript">
		// 改变订单状态
		function changeOrderItemState(obj,id){
			if(obj.value=='1'){
				return;
			}
			$('#ordersItemTable').load('updateOrdersItemState.do?state='+obj.value+'&id='+id);
		}
	</script>
	
	<script type="text/javascript">
		// 修改管理员状态
		function changeAdminState(admin,state){
			$.post('changeAdminState.do',{id:admin,state:state},function(data){
				if(data.sucess==0){
					$('#tipContent').html(data.message);
	            	$("#asdf").trigger('click');
				}else{
					$('#backShowAdminWindowClose').trigger('click');
					if(state==2){
						$('#showAdminStateLabel'+admin).attr('class','label label-danger');
						$('#showAdminStateLabel'+admin).html('已被封禁');
					}else if(state==3){
						$('#showAdminStateLabel'+admin).attr('class','label label-success');
						$('#showAdminStateLabel'+admin).html('正常');
					}
				}
			});
		}
	
	
		// 发送添加管理员的验证码的邮件
		function sendBackAddAdminEmail(time){
			$('#sendBackAddAdminButton').attr('disabled','disabled');
		    setTimeout(function() {
		        var x = setInterval(function(){
		                time= time - 1000; //reduce each second
		                $('#sendBackAddAdminButton').css('width','140px');
		                $('#sendBackAddAdminButton').html((time/1000)%60+'秒后可重新发送');
		                if(time==0){
		                        clearInterval(x);
		                        $('#sendBackAddAdminButton').css('width','118px');
		                        $('#sendBackAddAdminButton').html('点击发送');
		                        $('#sendBackAddAdminButton').removeAttr('disabled');
		                }
		        }, 1000);
		    }, 1000);
		    
			$.post('sendBackAddAdminEmail.do',function(data){
				if(data.sucess==0){
					$('#tipContent').html(data.message);
	            	$("#asdf").trigger('click');
				}
			});
		}
		
		//修改订单状态
	
	</script>
	
	<script type="text/javascript">
	    //修改商家的状态
		function changeBusinessState(business,state){
			$.post('changeBusinessState.do',{id:business,state:state},function(data){
				if(data.sucess==0){
					$('#tipContent').html(data.message);
	            	$("#asdf").trigger('click');
				}else{
					$('.close').trigger('click');
					if(state==3){
						$('#showBusinessStateLabel'+business).attr('class','label label-warning');
						$('#showBusinessStateLabel'+business).html('黑名单');
					}else if(state==1){
						$('#showBusinessStateLabel'+business).attr('class','label label-success');
						$('#showBusinessStateLabel'+business).html('正常');
					}else if(state==4){
						$('#showBusinessStateLabel'+business).attr('class','label label-success');
						$('#showBusinessStateLabel'+business).html('正常');
					}
				}
			});
		}
	    
		 //修改用户的状态
		function changeUserState(user,state){
			$.post('changeUserState.do',{id:user,state:state},function(data){
				if(data.sucess==0){
					$('#tipContent').html(data.message);
	            	$("#asdf").trigger('click');
				}else{
					$('#backShowUserWindowClose').trigger('click');
					if(state==2){
						$('#showUserStateLabel'+user).attr('class','label label-success');
						$('#showUserStateLabel'+user).html('正常');
					}else if(state==3){
						$('#showUserStateLabel'+user).attr('class','label label-danger');
						$('#showUserStateLabel'+user).html('已被封禁');
					}else if(state==1){
						$('#showUserStateLabel'+user).attr('class','label label-success');
						$('#showUserStateLabel'+user).html('正常');
					}
				}
			});
		}
	</script>
	
	
	
	<!-- 页面跳转的js -->
	<script type="text/javascript">
		/*此js代码仅用于左侧菜单栏页面跳转*/
		
		// 到达商品添加页面
		function toProductAdd() {
			$('#page-wrapper').load('toProductAdd.do',function(){
				removeScrollBar();
			});
		}

		// 到达查找商品页面  管理员和商家都可以用
		function toProductFind() {
			$('#page-wrapper').load('toProductFind.do',function(){
				removeScrollBar();
			});
		}

		// 到达订单查询页面
		function toOrderFind() {
			$('#page-wrapper').load('toOrderFind.do',function(){
				removeScrollBar();
			});
		}

		// 到达客服页面
		function toCustomerService() {
			// 先加载thymeleaf页面 然后执行格式化滚动条js
			$('#page-wrapper').load('toCustomerService.do',function(){
				removeScrollBar();
			});
		}

		// 到达分类管理页面
		function toClassification() {
			$('#page-wrapper').load('toClassificiation.do',function(){
				removeScrollBar();
			});
		}

		// 到达商家管理页面
		function toBusinessAudit() {
			$('#page-wrapper').load('toBusinessAudit.do',function(){
				removeScrollBar();
			});
		}
		
		// 到达用户管理页面
		function toUserFind() {
			$('#page-wrapper').load('toUserFind.do',function(){
				removeScrollBar();
			});
		}
		
		// 到达管理员管理页面
		function toAdminFind() {
			$('#page-wrapper').load('toAdminFind.do',function(){
				removeScrollBar();
			});
		}
		
		// 到达编辑公告页面
		function toNoticeWrite() {
			$('#page-wrapper').load('toNoticeWrite.do',function(){
				removeScrollBar();
			});
		}
		
		// 到达公告列表页面
		function toNoticeList() {
			$('#page-wrapper').load('toNoticeList.do',function(){
				removeScrollBar();
			});
		}
		
		// 到达财务报表页面
		function toFinancialChart(){
			$('#page-wrapper').load('toFinancialChart.do',function(){
				removeScrollBar();
			});
		}
		
		// 到达商家个人信息界面
		function toBusinessInfo(){
			$('#page-wrapper').load('toBusinessInfo.do',function(){
				removeScrollBar();
			});
		}
	</script>
	<!-- //页面跳转的js -->
	<!-- 商品添加页面的js -->
	<script type="text/javascript">
		/* var specsNum = 1;
		var imageNum = 1; */
		var addrNum = 1;
		var bigTypeNum = 1;
		var smallTypeNum = 1;
		
		// 添加大类型行
		function addBigTypeList(){
			$('#bigType-list'+bigTypeNum+' .bigType-list-plus'+bigTypeNum).hide();
			$('#bigType-list'+bigTypeNum+' .bigType-list-reduce'+bigTypeNum).css('display','none');
			bigTypeNum = bigTypeNum + 1;
			var bigTypeContent = '<div class="col-sm-8" id="bigType-list'+bigTypeNum+'" style="float: none;margin-top:5px;">'
						+'<span class="bigType-num">'+bigTypeNum+'</span>.&nbsp;'
						+'<input type="text" class="form-control addBigTypeName" style="width: 20%; display: inline-block;" name="name" placeholder="大类型" value="" required>&nbsp;&nbsp;'
						+'<a class="bigType-list-reduce'+bigTypeNum+'" href="javascript:void(0)" onclick="reduceBigTypeList('+bigTypeNum+')" style="background-image: url(images/reduce.svg)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>'
						+'<a class="bigType-list-plus'+bigTypeNum+'" href="javascript:void(0)" onclick="addBigTypeList()" style="background-image: url(images/plus.svg);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>'
						+'</div>';
			$('#bigType-list').append(bigTypeContent);
		}
		
		// 移除大类型行
		function reduceBigTypeList(num){
			if(num == 1){
				var bigTypeContent = $('#bigType-list'+num+' input').val();
				
				if(bigTypeContent != null || bigTypeContent != ''){
					$('#bigType-list'+num+' input').val('');
					return;
				}else{
					return;
				}
			}
			$('#bigType-list'+num).remove();
			bigTypeNum --;
			$('#bigType-list'+bigTypeNum+' .bigType-list-plus'+bigTypeNum).css('display','inline');
			$('#bigType-list'+bigTypeNum+' .bigType-list-reduce'+bigTypeNum).css('display','inline');
		}
		
		// 添加小类型行
		function addSmallTypeList(){
			$('#smallType-list'+smallTypeNum+' .smallType-list-plus'+smallTypeNum).hide();
			$('#smallType-list'+smallTypeNum+' .smallType-list-reduce'+smallTypeNum).css('display','none');
			smallTypeNum = smallTypeNum + 1;
			var smallTypeContent = '<div class="col-sm-8" id="smallType-list'+smallTypeNum+'" style="float: none;margin-top:1%">'
								+'<span class="smallType-num">'+smallTypeNum+'</span>.&nbsp;'
								+'<input type="text" class="form-control addSmallType" style="width: 20%; display: inline-block;" name="name" placeholder="小类型" value="" required>&nbsp;&nbsp;'
								+'<a class="smallType-list-reduce'+smallTypeNum+'" href="javascript:void(0)" onclick="reduceSmallTypeList('+smallTypeNum+')" style="background-image: url(images/reduce.svg)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>'
								+'<a class="smallType-list-plus'+smallTypeNum+'" href="javascript:void(0)" onclick="addSmallTypeList()" style="background-image: url(images/plus.svg);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></div>';
			$('#smallType-list').append(smallTypeContent);
		}
		
		// 移除小类型行
		function reduceSmallTypeList(num){
			if(num == 1){
				var smallTypeContent = $('#bigType-list'+num+' input').val();
				
				if(smallTypeContent != null || smallTypeContent != ''){
					$('#smallType-list'+num+' input').val('');
					return;
				}else{
					return;
				}
			}
			$('#smallType-list'+num).remove();
			smallTypeNum --;
			$('#smallType-list'+smallTypeNum+' .smallType-list-plus'+smallTypeNum).css('display','inline');
			$('#smallType-list'+smallTypeNum+' .smallType-list-reduce'+smallTypeNum).css('display','inline');
		}
		
		// 点击添加地址行
		function addAddrList(){
			$('#addr-list'+addrNum+' .addr-list-plus'+addrNum).css('display','none');
			$('#addr-list'+addrNum+' .addr-list-reduce'+addrNum).css('display','none');
			addrNum = addrNum + 1;
			var addrContent = '<div style="margin-left: 8.6%;margin-top: 1%;" id="addr-list'+addrNum+'">'
						+'<span class="addr-num">'+addrNum+'</span>.&nbsp;'
						+'<input type="text" name="addr" style="width: 27.4%;" value="" placeholder="商家地址" />'
						+'<a class="addr-list-reduce'+addrNum+'" href="javascript:void(0)" onclick="reduceAddrList('+addrNum+')" style="background-image: url(images/reduce.svg)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>'
						+'<a class="addr-list-plus'+addrNum+'" href="javascript:void(0)" onclick="addAddrList()" style="background-image: url(images/plus.svg);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>'
						+'</div>';
			$('#addr-list').append(addrContent);
			$('#addr-save').show();
		}
		
		// 点击移除地址行
		function reduceAddrList(num){
			if(num == 1){
				var addrListContent = $('#addr-list'+num+' input').val();
				
				if(addrListContent != null || addrListContent != ''){
					//$('#addr-list'+num+' input').val('');
					$('#addr-list'+num+' input').removeAttr('disabled')
					$('#addr-save').show();
					return;
				}else{
					return;
				}
			}
			$('#addr-list'+num).remove();
			addrNum --;
			$('#addr-list'+addrNum+' .addr-list-plus'+addrNum).css('display','inline');
			$('#addr-list'+addrNum+' .addr-list-reduce'+addrNum).css('display','inline');
		}
		
		// 点击保存地址行
		function saveAddr(){
			// 成功后
			$('#addr-save').hide();
			$('#addr-list input').attr('disabled','disabled');
		}
		
		/* // 添加图片上传input
		function addImageList(){
			$('#image-list'+imageNum+' .image-list-plus'+imageNum).css('display','none');
			$('#image-list'+imageNum+' .image-list-reduce'+imageNum).css('display','none');
			imageNum = imageNum + 1;
			var imageContent = '<div class="col-sm-8" style="margin-left: 16.65%; margin-top: 10px;" id="image-list'+imageNum+'">'
						+'<span class="image-num">'+imageNum+'</span>. '
						+'<input type="file"  class="form-control  productSpecsImage" style="width: 30%; display: inline-block;" name="name" value="" required>&nbsp;&nbsp;'
						+'<a class="image-list-reduce'+imageNum+'" href="javascript:void(0)" onclick="reduceImageList('+imageNum+')" style="background-image: url(images/reduce.svg)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>'
						+'<a class="image-list-plus'+imageNum+'" href="javascript:void(0)" onclick="addImageList()" style="background-image: url(images/plus.svg);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>'
						+'</div>';
			$('#image-list').append(imageContent);
		}
		
		// 删除图片上传input
		function reduceImageList(num){
			if(num == 1){
				var imageListContent = $('#image-list'+num+' input').val();
				
				if(imageListContent != null || imageListContent != ''){
					$('#image-list'+num+' input').val('');
					return;
				}else{
					return;
				}
			}
			$('#image-list'+num).remove();
			imageNum --;
			$('#image-list'+imageNum+' .image-list-plus'+imageNum).css('display','inline');
			$('#image-list'+imageNum+' .image-list-reduce'+imageNum).css('display','inline');
		}
		
		// 添加规格input组
		function addSpecsList(){
			
			$('#specs-list'+specsNum+' .specs-list-plus'+specsNum).css('display','none');
			$('#specs-list'+specsNum+' .specs-list-reduce'+specsNum).css('display','none');
			specsNum = specsNum + 1;
			var specsContent = '<div class="col-sm-8" style="margin-left: 16.65%; margin-top: 10px;" id="specs-list'+specsNum+'">'
						+'<span class="specs-num">'+specsNum+'</span>. '
						+'<input type="text" class="form-control productSpecsName" style="width: 20%; display: inline-block;"name="name" placeholder="商品规格" value="" required>&nbsp;&nbsp;&nbsp;'
						+'<input type="number" class="form-control productSpecsNum" style="width: 15%; display: inline-block;" name="name" placeholder="此规格数量" value="" required>&nbsp;&nbsp;&nbsp;'
						+'<input type="number" min="0.00" step="0.01" class="form-control productSpecsPrice" style="width: 15%; display: inline-block;" name="name" placeholder="此规格价格" value="" required>&nbsp;'
						+'<a class="specs-list-reduce'+specsNum+'" href="javascript:void(0)" onclick="reduceSpecsList('+specsNum+')" style="background-image: url(images/reduce.svg)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>'
						+'<a class="specs-list-plus'+specsNum+'" href="javascript:void(0)" onclick="addSpecsList()" style="background-image: url(images/plus.svg);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>'
						+'</div>';
			$('#specs-list').append(specsContent);
		}
		
		// 删除规格input组
		function reduceSpecsList(num){
			if(num == 1){
				var specsListContent = $('#specs-list'+num+' input').val();
				
				if(specsListContent != null || specsListContent != ''){
					$('#specs-list'+num+' input').val('');
					return;
				}else{
					return;
				}
			}
			$('#specs-list'+num).remove();
			specsNum --;
			$('#specs-list'+specsNum+' .specs-list-plus'+specsNum).css('display','inline');
			$('#specs-list'+specsNum+' .specs-list-reduce'+specsNum).css('display','inline');
		} */
	</script>
	<!-- //商品添加页面的js -->
	<!-- 首页店铺收入走向图的js -->
	<script type="text/javascript" th:inline="javascript">
		var indexChartData = [[${indexChartData}]];
		am4core.useTheme(am4themes_animated);
		
		var chart = am4core.create("chartdiv", am4charts.XYChart);
		chart.paddingRight = 20;
		
		var data = [];
		var visits = 0;
		var previousValue;
		
		for (var i = 0; i < indexChartData.length; i++) {
			visits = indexChartData[i].dailyIncome;
			
			if(i > 0){
			    // add color to previous data item depending on whether current value is less or more than previous value
			    if(previousValue <= visits){
			        data[i - 1].color = chart.colors.getIndex(0);
			    }
			    else{
			        data[i - 1].color = chart.colors.getIndex(5);
			    }
			}    
			
			data.push({ date: new Date(indexChartData[i].year, indexChartData[i].month, indexChartData[i].day), value: visits });
			previousValue = visits;
		}
		
		chart.data = data;
		
		var dateAxis = chart.xAxes.push(new am4charts.DateAxis());
		dateAxis.renderer.grid.template.location = 0;
		
		var valueAxis = chart.yAxes.push(new am4charts.ValueAxis());
		valueAxis.tooltip.disabled = true;
		valueAxis.renderer.minWidth = 35;
		
		var series = chart.series.push(new am4charts.LineSeries());
		series.dataFields.dateX = "date";
		series.dataFields.valueY = "value";
		series.strokeWidth = 2;
		series.tooltipText = "{valueY} {valueY.change}";
		
		//set stroke property field
		series.propertyFields.stroke = "color";
		
		chart.cursor = new am4charts.XYCursor();
		
		var scrollbarX = new am4core.Scrollbar();
		chart.scrollbarX = scrollbarX;
	</script>
	<script>
		var menuLeft = document.getElementById('cbp-spmenu-s1'), showLeftPush = document
				.getElementById('showLeftPush'), body = document.body;

		showLeftPush.onclick = function() {
			classie.toggle(this, 'active');
			classie.toggle(body, 'cbp-spmenu-push-toright');
			classie.toggle(menuLeft, 'cbp-spmenu-open');
			disableOther('showLeftPush');
		};

		function disableOther(button) {
			if (button !== 'showLeftPush') {
				classie.toggle(showLeftPush, 'disabled');
			}
		}
	</script>
	<!-- //首页店铺收入走向图的js -->
	<!--scrolling js-->
	<script src="js/jquery.nicescroll.js"></script>
	<script src="js/scripts.js"></script>
	<!--//scrolling js-->
	<!-- Bootstrap Core JavaScript -->
	<script src="js/bootstrap.js"></script>
</body>
</html>